var windowName = "siteOtherInfo";
var Page
apiready = function(){
    onWindowShow(function () {
        var cur = getLocData("curSite")
        Page.curSite = cur;
        getData(Page)
    })
    onWindowHide(function () {
    })
    console.log("index page is OK");
    Page = createVM("#Page",{
        //页面数据
        curSite:{},
        en: {
            "id": "",
            "siteId": "",
            "gongchengmingxi": "",
            "yanshouqingkuang": "",
            "xiangmubianhao": "",
            "shigongdanwei": "",
            "qianbaojine": "",
            "pifuzhi": "",
            "paigongshijian": "",
            "songshenjine": "",
            "shendingzhi": "",
            "shigongdanweilianxiren": "",
            "qianbaohao": "",
            "qianbaobiaoti": "",
            "songshenriqi": "",
            "xiangmujingli": "",
            "baopianfuzeren": "",
            "fanglankaishishijian": "",
            "fanglanwanchegnshijian": "",
            "kaitongshijian": "",
            "yanshoushijian": ""
        },
        tab:0
    },{
        //页面方法
        "init":function () {
        }
        ,"submit":function() {
            var _this = this
            this.$refs.form.validate().then((result) => {
                logJson(result)
                if (result){
                    // logJson(this.en);
                    // return;
                    var param = createForm(this.en)
                    param["sid"] = this.en.siteId
                    apiPost("/app/site/otherInfo",param,function (res) {
                        logJson(res)
                        showToast(res.message)
                    })

                }else{
                    showToast("请检查输入")
                }
            });
        }
    })

    Page.init()

}
function getData(_this) {
    startPullDownRefresh()
    var sid = _this.curSite.id


    apiGet("/app/site/otherInfo",{sid:sid},function (res) {
        _this.en = res.data.en
        logJson(res)
    })
}